home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / dynRelEditorPane.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  2.8 KB  |  97 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. // Script:    dynRelEditorPane.mel
  19. //
  20. // SYNOPSIS
  21. //        Creates a panel that contains a dynamics relationship editor.
  22. //
  23.  
  24.  
  25. global proc dynRelEditorPane(string $panelName) {
  26.  
  27.     global string $gMainPane;
  28.  
  29.     if (! `scriptedPanelType -exists dynRelEdPanel`) {
  30.         scriptedPanelType 
  31.             -createCallback "createDynREPanel"
  32.             -addCallback "addDynREPanel" 
  33.             -removeCallback "removeDynREPanel"
  34.             dynRelEdPanel;
  35.  
  36.         setParent $gMainPane;
  37.         scriptedPanel -unParent -type "dynRelEdPanel" $panelName;            
  38.     }
  39. }
  40.  
  41. global proc buildDynREContextHelpItems(string $nameRoot, string $menuParent)
  42. //
  43. //  Description:
  44. //        Build context sensitive menu items
  45. //        
  46. //  Input Arguments:
  47. //        $nameRoot - name to use as the root of all item names
  48. //        $menuParent - the name of the parent of this menu
  49. //
  50. //  Return Value:
  51. //      None
  52. //
  53. {
  54.     menuItem -label "Help on Dynamic Relationships Editor..."
  55.         -enableCommandRepeat false
  56.         -command "showHelp DynamicRelationship";
  57. }
  58.  
  59. global proc createDynREPanel(string $whichPanel)
  60. {
  61.     outlinerEditor
  62.         -unParent
  63.         -mainListConnection worldList
  64.         -selectionConnection modelList
  65.         -highlightActive true
  66.         ($whichPanel+"dynRelOutlinerEditor");
  67.     dynRelEditor -unParent ($whichPanel+"dynRelEditor");
  68.  
  69.     //    Add support for the Context Sensitive Help Menu.
  70.     //
  71.     addContextHelpProc $whichPanel "buildDynREContextHelpItems";
  72. }
  73.  
  74. global proc addDynREPanel( string $whichPanel ) {
  75.  
  76.     string $edParent;
  77.  
  78.     frameLayout -bv 0 -cll 0 -lv 0 dynREFrameLayout;
  79.         $edParent = `paneLayout 
  80.                         -configuration "vertical2" 
  81.                         -ps 1 35 100 dynREPaneLayout`;
  82.  
  83.         outlinerEditor -e -parent $edParent 
  84.             ($whichPanel+"dynRelOutlinerEditor");
  85.         dynRelEditor -e -parent $edParent 
  86.             ($whichPanel+"dynRelEditor");
  87. }
  88.     
  89. global proc removeDynREPanel(string $whichPanel)
  90. {
  91.         outlinerEditor -e -unParent 
  92.             ($whichPanel+"dynRelOutlinerEditor");
  93.         dynRelEditor -e -unParent 
  94.             ($whichPanel+"dynRelEditor");
  95. }
  96.  
  97.